package com.xuan.xwaterfall.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 线程管理
 * 
 * @author ZZJ
 */
public class ExecutorUtil {

    private static ExecutorService executorService;
    static {
        int cpuNums = Runtime.getRuntime().availableProcessors();
        // 获取当前系统的CPU 数目
        executorService = Executors.newFixedThreadPool(cpuNums * 2);

    }

    public static ExecutorService getFixedExecutorService() {
        return executorService;
    }
}
